package com.education.welco.service.impl;

import java.util.HashMap;
import java.util.List;

import com.education.common.utils.Convert;
import com.education.welco.mapper.TClassroomMapper;
import com.education.welco.pojo.TClassroom;
import com.education.welco.service.ITClassroomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 教室 服务层实现
 *
 * @author d
 * @date 2020-05-11
 */
@Service
public class TClassroomServiceImpl implements ITClassroomService {

    @Autowired
    private TClassroomMapper tClassroomMapper;

    /**
     * 查询教室信息
     *
     * @param id 教室ID
     * @return 教室信息
     */
    @Override
    public TClassroom selectTClassroomById(Integer id) {
        return tClassroomMapper.selectTClassroomById(id);
    }

    /**
     * 查询没用被占用的教室列表
     *
     * @param map 教室信息
     * @return 教室集合
     */
    @Override
    public List<TClassroom> selectTClassroomListNotIn(HashMap<String, Object> map) {
        return tClassroomMapper.selectTClassroomListNotIn(map);
    }

    /**
     * 查询教室列表
     *
     * @param tClassroom 教室信息
     * @return 教室集合
     */
    @Override
    public List<TClassroom> selectTClassroomList(TClassroom tClassroom) {
        return tClassroomMapper.selectTClassroomList(tClassroom);
    }

    /**
     * 新增教室
     *
     * @param tClassroom 教室信息
     * @return 结果
     */
    @Override
    public int insertTClassroom(TClassroom tClassroom) {
        return tClassroomMapper.insertTClassroom(tClassroom);
    }

    /**
     * 修改教室
     *
     * @param tClassroom 教室信息
     * @return 结果
     */
    @Override
    public int updateTClassroom(TClassroom tClassroom) {
        return tClassroomMapper.updateTClassroom(tClassroom);
    }

    /**
     * 删除教室对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTClassroomByIds(String ids) {
        return tClassroomMapper.deleteTClassroomByIds(Convert.toStrArray(ids));
    }
}